home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11265 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: macromedia.com!news
  2. From: "Seth M. Livingston" <slivingston@macromedia.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Borland C++ 4.52 problem
  5. Date: Wed, 13 Mar 1996 09:47:18 -0600
  6. Organization: Macromedia
  7. Message-ID: <3146EE06.6F84@macromedia.com>
  8. References: <4i35jt$8jl@newsbf02.news.aol.com>
  9. NNTP-Posting-Host: 198.95.246.126
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win95; I)
  14.  
  15. PFrank3465 wrote:
  16. > I'm a novice programmer and I'm trying to write a simple word guessing
  17. > game... [snip]
  18.  
  19. At first glance, I'd want to make sure the I was debugging the same 
  20. build that I was executing. I've done that more than once.
  21.  
  22. At second glance, I'd say the source of your bug is your code. Debuggers 
  23. are nice, but they're no good unless you've really got your Sherlock 
  24. Holmes hat on.
  25.  
  26. Try the following:
  27.  
  28.  1. Take a break.
  29.  2. Describe the exact nature of the bug in English (or appropriate
  30.     language) sentences. For example, "Storage for the secret word
  31.     is being overwritten by data from the guess word," or "the
  32.     pointer to the secret word is pointing to the guess word."
  33.  3. Recognize that your bug is actually a symptom. Looking for
  34.     symptoms will only get you so far. Look for CAUSES.
  35.  4. Broaden your horizons. You may have located the symptom, but the
  36.     cause could probably be coming from many different places in
  37.     your code.
  38.  5. In this specific case, look for incorrect pointers in assignment
  39.     and increment statements. Also, if you are manipulating pointers,
  40.     make sure you restore them to the proper position for the next
  41.     manipulation.
  42.  
  43. Unfortunately, there aren't many good books (or academic classes) on 
  44. debugging. If anyone has any good suggestions, I'd love to see them.
  45.  
  46. -- 
  47. Seth M. Livingston
  48. Macromedia FreeHand XDK Support
  49. slivingston@macromedia.com
  50.